home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / fortran / toolpack.000 / toolpack / toolpack1.2 / scriptsource / getlst.s < prev    next >
Encoding:
Text File  |  1993-10-04  |  2.0 KB  |  71 lines

  1. #! /bin/csh
  2. #  getlst is a csh script to produce and send to standard output a listing
  3. #  of a Fortran program showing statement and token numbers, using ISTLX.
  4. #
  5. #
  6. #  Invocation:
  7. #
  8. #  getlst Fortran_source_file
  9. #
  10. #  Check command line validity.
  11. if ( $#argv < 1 ) then
  12. TOOLPACKPATH/toolpack1.2/util/echoerr \
  13. Invocation:
  14. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  15. TOOLPACKPATH/toolpack1.2/util/echoerr \
  16. getlst Fortran_source_file
  17. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  18. TOOLPACKPATH/toolpack1.2/util/echoerr \
  19. Listing is sent to standard output and may be redirected to a file.
  20. TOOLPACKPATH/toolpack1.2/util/echoerr \
  21. Error/Warning messages are embedded in the listing.
  22. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  23.    exit
  24. endif
  25. #  Check that Fortran_source_file exists.
  26. if ( -e $1 == 0 ) then
  27. TOOLPACKPATH/toolpack1.2/util/echoerr \
  28. "'$1' does not exist."
  29.    exit
  30. endif
  31. #
  32. #  Create PFS.  If PFS already exists, exit with an advisory message.
  33. #
  34. if ( -e _.TOOLPACK == 0 ) then
  35.    mkdir _.TOOLPACK
  36. else
  37. TOOLPACKPATH/toolpack1.2/util/echoerr \
  38. Toolpack-created directory '"_.TOOLPACK"' exists. \
  39. Remove with script '"discard"'.
  40.    exit
  41. endif
  42. #  Make a tab-free copy of the Fortran source and use it as source.
  43. set src = src_gl
  44. expand $1 > _.TOOLPACK/$src
  45. #  Lexer token stream file name.
  46. set tkn = tkn_gl
  47. #  Lexer comment file name.
  48. set cmt = cmt_gl
  49. #  Lexer token listing file name.
  50. set lst = lst_gl
  51. #  Create the interprocess file IST.CMD and append parameters for ISTLX.
  52. TOOLPACKPATH/toolpack1.2/util/mkipf \
  53. $src $lst $tkn $cmt
  54. #
  55. #  Invoke ISTLX.
  56. #
  57. TOOLPACKPATH/toolpack1.2/exec/istlx.u
  58. #
  59. echo ""
  60. echo In the following listing, the first number is the statement number and
  61. echo the second number is the number of the first token in the statement.
  62. echo Statements are numbered within a program unit, tokens within the file.
  63. echo Scanning errors are indicated.  When a scanning error occurs, the
  64. echo scanner resets and continues.
  65. echo ""
  66. #  Write the listing to standard output.
  67. cat _.TOOLPACK/$lst
  68. #
  69. /bin/rm -r _.TOOLPACK
  70. #
  71.